<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <button>click</button>
    <script>
        var name_ = '阿黄';
        let obj = {
            name_: "ergou",
            sayname_1: function () {
                console.log(this.name_);
                return () => {
                    console.log('0.0.0.0.0::::::', this.name_);
                    return this
                }
            },
            sayname_2: () => {
                console.log(window);
                console.log(this.name_);
                return () => {
                    console.log('1.1.1.1.1.1::::::', this.name_);
                    return this
                }
            }
        }

        // console.log(obj.sayname_1()());
        // console.log(obj.sayname_2()());

        // ==================
        // 点击按钮执行普通函数和箭头函数
        // document.getElementsByTagName('button')[0].onclick = function() {
        //     console.log(this);
        // }
        document.getElementsByTagName('button')[0].onclick = () => {
            console.log(this);
        }
    </script>
</body>

</html>